from os.path import join, basename, dirname

if __name__ == '__main__':
    p1 = r"d:\test"
    p2 = r"content.txt"

    print(join(p1, p2))

    p3 = r"e:\content.txt"

    print(join(p1, p3))

    print(dirname(p1))
    print(basename(p1))
